/* 
 * File:   hfgl_surface.cpp
 * Author: Satan
 * 
 * Created on September 12, 2012, 11:01 PM
 */

#include "hfgl/hfgl_surface.h"

hfgl_surface::hfgl_surface()
{
    m_countPolygon = 0;
    m_polygons = NULL;
}

hfgl_surface::hfgl_surface(int count, hfgl_polygon **polygons)
{
    m_countPolygon = count;
    m_polygons = polygons;
}

hfgl_surface::hfgl_surface(const hfgl_surface& orig) 
{
}

hfgl_surface::~hfgl_surface() 
{
    clear();
}

void hfgl_surface::clear()
{
    if (m_polygons)
    {
        for (int i = 0; i < m_countPolygon; i++)
        {
            hfgl_polygon* pol = m_polygons[i];
            delete pol;
        };
        m_countPolygon = 0;
        delete[] m_polygons;
        m_polygons= 0;
    }
}

int hfgl_surface::getCountPolygons()
{
    return m_countPolygon;
}
hfgl_polygon** hfgl_surface::getPolygons()
{
    return m_polygons;
}